package com.java.yihur.coffeebar.decorator;

import com.java.yihur.coffeebar.BaseDrink;

/**
 * 装饰者
 *
 * @author yihur
 */
public class Decorator extends BaseDrink {

    private BaseDrink obj;

    public Decorator(BaseDrink obj) {
        this.obj = obj;
    }

    @Override
    public float cost() {
        return super.getPrice() + obj.cost();
    }

    @Override
    public String getDescription() {
        return super.description + "-" + super.getPrice() + "&&" + obj.getDescription();
    }

}
